package com.demo;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

/**
 * @Author 56465
 * @Create 2024/7/31 10:22
 */
public class Demo {
    public static void main(String[] args) throws ScriptException {
        ScriptEngineManager scriptEngineManager = new ScriptEngineManager();
        //ScriptEngine engine = scriptEngineManager.getEngineByName("graal.js");
        ScriptEngine engine = scriptEngineManager.getEngineByName("nashorn");
        System.out.println("engine = " + engine);
        engine.eval("print('Hello World!');");
    }
}
